home *** CD-ROM | disk | FTP | other *** search
/ Chip 1996 April / CHIP 1996 aprilis (CD06).zip / CHIP_CD06.ISO / microsft / vb4 / vb4-4.cab / picview.frm < prev    next >
Text File  |  1995-08-15  |  3KB  |  113 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Picture Viewer"
  4.    ClientHeight    =   4830
  5.    ClientLeft      =   1065
  6.    ClientTop       =   1695
  7.    ClientWidth     =   7395
  8.    ClipControls    =   0   'False
  9.    BeginProperty Font 
  10.       name            =   "MS Sans Serif"
  11.       charset         =   1
  12.       weight          =   700
  13.       size            =   8.25
  14.       underline       =   0   'False
  15.       italic          =   0   'False
  16.       strikethrough   =   0   'False
  17.    EndProperty
  18.    Height          =   5235
  19.    Left            =   1005
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   4830
  22.    ScaleWidth      =   7395
  23.    Top             =   1350
  24.    Width           =   7515
  25.    Begin VB.CommandButton Command1 
  26.       Caption         =   "E&xit"
  27.       Height          =   495
  28.       Left            =   5520
  29.       TabIndex        =   4
  30.       Top             =   4080
  31.       Width           =   1215
  32.    End
  33.    Begin VB.FileListBox File1 
  34.       Height          =   1395
  35.       Left            =   600
  36.       Pattern         =   "*.bmp;*.wmf;*.ico"
  37.       TabIndex        =   2
  38.       Top             =   2400
  39.       Width           =   2895
  40.    End
  41.    Begin VB.DirListBox Dir1 
  42.       Height          =   1575
  43.       Left            =   600
  44.       TabIndex        =   1
  45.       Top             =   720
  46.       Width           =   2895
  47.    End
  48.    Begin VB.DriveListBox Drive1 
  49.       Height          =   1530
  50.       Left            =   600
  51.       TabIndex        =   0
  52.       Top             =   360
  53.       Width           =   2895
  54.    End
  55.    Begin VB.Label Label1 
  56.       BorderStyle     =   1  'Fixed Single
  57.       Height          =   495
  58.       Left            =   3720
  59.       TabIndex        =   3
  60.       Top             =   3255
  61.       Width           =   3015
  62.    End
  63.    Begin VB.Image Open 
  64.       BorderStyle     =   1  'Fixed Single
  65.       Height          =   2775
  66.       Left            =   3720
  67.       Stretch         =   -1  'True
  68.       Top             =   360
  69.       Width           =   3015
  70.    End
  71. End
  72. Attribute VB_Name = "Form1"
  73. Attribute VB_Creatable = False
  74. Attribute VB_Exposed = False
  75.  
  76. Private Sub Command1_Click()
  77.     Unload Me
  78.     End
  79. End Sub
  80.  
  81. Private Sub Dir1_Change()
  82.     ' When the directory is changed, update the path in the file list box control.
  83.     file1.Path = Dir1.Path
  84. End Sub
  85.  
  86. Private Sub Drive1_Change()
  87.     ' When the drive is changed, update the directory list box control.
  88.     ' (This also triggers the Dir1_Change event for the directory list box control).
  89.     Dir1.Path = Drive1.Drive
  90. End Sub
  91.  
  92. Private Sub File1_DblClick()
  93.     ' When at the root level (for example, C:\), the Path property
  94.     ' has a backslash (\) at the end.  When at any other level,
  95.     ' there is no final \.  This code handles either case to build
  96.     ' the complete path and filename of the selected file.
  97.     If Right(file1.Path, 1) <> "\" Then
  98.         label1.Caption = file1.Path & "\" & file1.FileName
  99.     Else
  100.         label1.Caption = file1.Path & file1.FileName
  101.     End If
  102.         ' Load the selected picture file.
  103.         Form1.open.Picture = LoadPicture(label1.Caption)
  104. End Sub
  105.  
  106. Private Sub Form_Load()
  107.     ' Set the drive and path for the controls to the drive
  108.     ' and directory where this application is located.
  109.     Drive1.Drive = App.Path
  110.     Dir1.Path = App.Path
  111. End Sub
  112.  
  113.